﻿using System;
using System.Collections.Generic;
using System.Windows;
using RWLib;

namespace RW_GUI
{
    /// <summary>
    /// Interaction logic for AddInitialConditionWindow.xaml
    /// </summary>
    public partial class AddInitialConditionWindow : Window
    {
        public FormulaModel Model;
        public bool valid;
        private List<Fluent> _fluents;
        public AddInitialConditionWindow(List<Fluent> fluents)
        {
            _fluents = fluents;
            InitializeComponent();
        }

        private void btn_AddFluentEffects_Click(object sender, RoutedEventArgs e)
        {
            var fcw = new FluentChoiceWindow(_fluents, String.IsNullOrEmpty(txt_EffFormula.Text.Trim()));
            fcw.ShowDialog();
            txt_EffFormula.Text += fcw.Name;
        }

        private void btn_Cancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
        private void btn_Save_Click(object sender, RoutedEventArgs e)
        {
            valid = true;
            ActionTypeEnum en;
            Model = new FormulaModel(txt_EffFormula.Text);
            Close();
        }
    }
}
